<style>
.left{padding-top:7px;text-align: left !important;}
</style>

	<form xmlns:th="http://www.w3.org/1999/xhtml" method="post" action="user/mod" class="form-horizontal bv-form" id="form_user_info_mod_12">
			<input  type="hidden" value="" name="id" th:value="${user.id}"/>
			<div class="form-body">

				<div class="form-group">
					<label  class="col-md-3 control-label">合伙人等级:
					</label>
					<div class="col-md-9">
						<select name="vipType" id="vipTypeSelect"  style="width:160px;margin-right:10px;padding: 3px;" >
							<option th:value="${user.vipType}" th:if="${user.vipType!=0}" th:text="${user.vipInfo.vipName}"></option>
							<option th:value="${user.vipType}" th:if="${user.vipType==0}">粉丝</option>
							<option th:each="vip:${vipInfos}"  th:value="${vip.id}" th:text="'--'+${vip.vipName}+'--'"></option>
						</select>
					</div>
				</div>

				<!--10-8-->
				<div class="form-group" style="display: none" id="provinceDiv">
					<label  class="col-md-3 control-label">省份:
					</label>
					<div class="col-md-9 left ">
						<select name="provinceRegionId" id="regionProvince0" >
							<option value="0">--省份--</option>
							<option th:each="pro:${provinces}"  th:value="${pro.regionId}" th:text="'--'+${pro.regionName}+'--'"></option>
						</select>
					</div>
				</div>

				<div class="form-group" id="regionDiv" style="display: none">
					<label  class="col-md-3 control-label">区县:
					</label>
					<div class="col-md-9 left ">
						<select name="provinceRegionId" id="regionProvince1">
							<option value="0">--省份--</option>
							<option th:each="pro:${provinces}"  th:value="${pro.regionId}" th:text="'--'+${pro.regionName}+'--'"></option>
						</select>
						<select name="cityRegionId" id="regionCity1">
							<option value="0">--市--</option>
						</select>
						<select name="countyRegionId" id="regionCounty1">
							<option value="0">--区县--</option>
						</select>
					</div>
				</div>

		</div>
			<div class="  form-group ">
				<div class="pull-right form-btn">
					<button class="btn btn-warning" type="reset"><i class="ace-icon fa fa-undo bigger-110"></i> 重置</button>
					<button type="submit" class="btn btn-info"><i class="ace-icon fa fa-check bigger-110"></i>确认</button>
				</div>
			</div>
	</form>

<script type="text/javascript">
jQuery(document).ready(function() {
	FormSamples.init({
		formId:'form_user_info_mod_12'
	});

	$("#vipTypeSelect").on("change",function(){
		var value = $(this).val();
		if (value==21){
			$("#provinceDiv").show();
			$("#regionDiv").hide();
		}else if (value==23){
			$("#regionDiv").show();
			$("#provinceDiv").hide();
		}else {
			$("#regionDiv").hide();
			$("#provinceDiv").hide();
		}
	});

	$("#regionProvince1").change(function(){
		var pid = $(this).val();
		$.post("region/cities",{parentId:pid},function(result){
			console.log(result);
			console.log(typeof result);
			var arr = result;
			var len = arr.length;
			var obj = document.getElementById("regionCity1");
			obj.innerHTML="";
			if(len>1){
				var nullOp = document.createElement("option");
				nullOp.setAttribute("value","");
				nullOp.appendChild(document.createTextNode("--市--"));
				obj.appendChild(nullOp);
			}
			$.each(arr, function(index, json){
				//alert(json.channelName);
				var nullOp = document.createElement("option");
				nullOp.setAttribute("value",json.regionId);
				nullOp.appendChild(document.createTextNode(json.regionName));
				obj.appendChild(nullOp);
			});
		});
	});

	$("#regionCity1").change(function(){
		var pid = $(this).val();
		$.post("region/counties",{parentId:pid},function(result){
			console.log(result);
			console.log(typeof result);
			var arr = result;
			var len = arr.length;
			var obj = document.getElementById("regionCounty1");
			obj.innerHTML="";
			if(len>1){
				var nullOp = document.createElement("option");
				nullOp.setAttribute("value","");
				nullOp.appendChild(document.createTextNode("--市--"));
				obj.appendChild(nullOp);
			}
			$.each(arr, function(index, json){
				//alert(json.channelName);
				var nullOp = document.createElement("option");
				nullOp.setAttribute("value",json.regionId);
				nullOp.appendChild(document.createTextNode(json.regionName));
				obj.appendChild(nullOp);
			});
		});
	});

});
</script>
